package com.converse.imageProcessor.imgProcess;

import android.content.Context;
import android.graphics.Bitmap;
import android.os.Bundle;

import com.converse.imageProcessor.R;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatImageView;

public class ImageProcessingActivity extends AppCompatActivity implements ImgProcessView {
    private AppCompatImageView mIvResult;
    private ImgProcessPresenter mPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_img_proccessor);
        mIvResult = findViewById(R.id.activity_image_processor_iv_result);
        mPresenter = new ImgProcessPresenter(this, getModel());

        mPresenter.startProcessImg(R.mipmap.number);
    }

    private ImgProcessModel getModel() {
        return new ImgProcessModelImpl();
    }


    @Override
    public void onGetResult(Bitmap bitmap) {
        mIvResult.setImageBitmap(bitmap);
    }

    @Override
    public Context getContext() {
        return this;
    }
}
